Repository navigation
feat(memory): kit memory search --fresh — recency-aware RRF ranking - #369
Merged
Merged
Conversation
Borrows the Cerebras knowledge-base ranking insight, kept on-charter (deterministic, zero-LLM; kit has one lexical retriever + recency, no embeddings/reranker). - fuseByRrf<T>(lists, keyOf, k=60): pure Reciprocal Rank Fusion — merges ranked lists by RANK, not score, so incommensurable signals combine without normalization. Deterministic tiebreak by key. Reusable primitive for future multi-signal fusion (e.g. provenance). - searchMessages gains opts.recencyBoost (default off → relevance-first order UNCHANGED). When on, it fetches a larger candidate pool and RRF-fuses bm25-relevance with recency, so a fresh still-relevant hit can outrank a marginally-more-relevant stale one; relevance still dominates. - kit memory search --fresh wires it; help/opencli contract updated. Tests: fuseByRrf (consensus > single #1, single-list identity, dedup, deterministic tiebreak); searchMessages --fresh promotes a fresh-but-weaker hit above a stale mid one while the strongest relevance match still leads. Full suite green (3013 pass / 0 fail). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
✅ Docker image built successfully
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Recency-aware recall for
kit memory search, borrowed from the Cerebras knowledge-base ranking stack (see the kit-research note) but kept on-charter: deterministic, zero-LLM. kit has one lexical retriever (FTS5 bm25, which already does IDF) plus a recency signal — no embeddings, no reranker model — so the honest borrow is fusing kit's two incommensurable signals (relevance + recency) by rank, not cargo-culting a multi-retriever/RRF+reranker pipeline.fuseByRrf(lists, keyOf, k=60)— a pure Reciprocal Rank Fusion primitive. Merges ranked lists by rank, not score, so signals with incompatible scales combine with no normalization;k=60(standard) makes cross-list consensus outweigh a single list's Governance harvest: code-review lenses, preflight gates, secrets runbooks #1. Deterministic tiebreak by key. Reusable for future multi-signal fusion (e.g. provenance from feat(memory): decision-lifecycle capture — idea/abandoned kinds + provenance #362).searchMessagesgainsopts.recencyBoost— off by default, so the relevance-first order is unchanged. When on, it fetches a larger candidate pool and RRF-fuses bm25-relevance with recency, so a fresh, still-relevant hit can outrank a marginally-more-relevant stale one ("when relevance is otherwise equal, the newer answer wins"). Relevance still dominates the top; recency breaks the lower ranks.kit memory search --freshwires the flag;memory searchhelp + OpenCLI contract updated.Why opt-in (no false green)
Making recency-fusion the default would change recall ordering that existing behavior/tests rely on (a 2-item RRF is a symmetric tie), and I can't prove universal improvement for decision-memory.
--freshdelivers the value for "what did we recently say about X" without silently regressing the relevance-first default.Tests
fuseByRrf: consensus beats a single Governance harvest: code-review lenses, preflight gates, secrets runbooks #1; single-list identity; dedup across lists; deterministic tiebreak.searchMessages --fresh: default is relevance-only;--freshpromotes a fresh-but-weaker hit above a stale mid one while the strongest relevance match still leads.🤖 Generated with Claude Code